function [Q,sse]=drawVariance(nu,Q_0,T_0)
% input:
%       - yt is K (or N)x T
%       - B is K (or N) X K*p (or N*q)
T_1= T_0+size(nu,2);
Qtemp=zeros(1,size(nu,1));
for ix=1:size(nu,1)
    sse=(nu(ix,:)*nu(ix,:)');
    Q_1=Q_0(ix,ix) + sse;
    Qtemp(ix) = iwishrnd(Q_1,T_1);
    % Qtemp(ix) = 1/gamrnd(T_1,1/Q_1);
end

Q = diag(Qtemp);
